feat(buzz-acp): isolate sessions by conversation thread - #2331
Conversation
445556b to
68345bc
Compare
|
We are hitting the exact failure mode this PR addresses in real team use on a current Buzz Desktop build. Sanitized repro:
We reproduced the same outcome with two independent bug roots sent nine seconds apart: only the second was picked up and shipped. The other 23 configured workers could not help because the in-flight boundary was the channel rather than the canonical root. This makes thread scoping a correctness and throughput issue, not only a context-window improvement. A bug/intake channel naturally uses one top-level thread per independent task; users reasonably expect those roots to claim separate workers while replies within each root remain serialized and context-continuous. The behavior proposed here—queue, cancellation, rotation, and session state keyed by conversation scope, with sibling roots executing concurrently—is exactly the contract we need. We would be happy to test a rebased version with a controlled three-root burst and verify:
At present the operational choices are either serial assignment in the intake channel or splitting work into extra channels, both of which underuse the configured pool and undermine the thread model. A rebase/review of this PR would remove that workaround. |
Signed-off-by: bbamnesia <[email protected]>
68345bc to
ad91e04
Compare
|
@skyerus The branch is now rebased onto current The repair now uses one canonical NIP-10 parser across relay ingestion and ACP scoping, keys queue/in-flight/session ownership and invalidation by conversation scope, prevents cross-root context hydration, closes active/idle/future model-switch lifecycle holes, and carries thread-root identity through observer telemetry/UI correlation. I also added a real-subprocess acceptance test for the burst you described: three simultaneous forum roots claim three fake ACP workers; same-root replies remain serialized to one owner/session; five source events produce exactly one prompt, callback, and terminal frame each; reactions/cleanup happen once; and no context crosses roots. Would you be willing to run your controlled three-root burst against this head and report what you see? Local verification on the final rebased commit:
|
Summary
Give each Buzz conversation thread its own ACP session while preserving channel-level behavior for unthreaded messages and DMs.
Behavior
!cancel,!rotate, queue deduplication, and retry state target the current conversation scopeTests
cargo test -p buzz-acp— 605 passedcargo fmt -p buzz-acp -- --check— passedcargo clippy -p buzz-acp --all-targets -- -D warnings— passedcargo check -p sprig— passedjust cireaches the workspace unit suite but currentmainhas an unrelated deterministicbuzz-dbfailure inreplica_fence::tests::fence_starts_closed_and_opens_on_advance: the assertion compares a microsecond-truncated stored timestamp with its original nanosecond value. The same isolated test fails without involving any files changed here.